package com.diipo.weibo;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.view.Window;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.ImageView;

public class PicActivity extends Activity{
	
	private ImageView mImageView;
	private Button mButton;
	private AsyncImageLoader asyncImageLoader = AsyncImageLoader.getInstance();

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		// TODO Auto-generated method stub
		super.onCreate(savedInstanceState);
		// Hide title 
        requestWindowFeature( Window.FEATURE_NO_TITLE );
		setContentView(R.layout.picture_view);
		
		Button btn = (Button) findViewById(R.id.btn_title_reply);
		btn.setVisibility(View.GONE);
		
		Intent intent = getIntent();
		String userId = intent.getStringExtra(ConfigInfo.COMM.USER_ID);
		String thumbnail = intent.getStringExtra(ConfigInfo.COMM.THUMBNAIL);
		
		Log.e(" pyb ", "  userId = " + userId + " , thumbnail = " + thumbnail);
		
		mImageView = (ImageView) findViewById(R.id.pic_show);
		mButton = (Button) findViewById(R.id.btn_title_back);
		
		asyncImageLoader.loadPortrait(thumbnail, mImageView);
		mButton.setOnClickListener(new OnClickListener() {
			@Override
			public void onClick(View v) {
				// TODO Auto-generated method stub
				Log.e(" pyb ", "  PicActivity back to the WeiboDetailsActivity,back was click..");
//				Intent i = new Intent(PicActivity.this, WeiboDetailsActivity.class);
//				startActivity(i);
				finish();
			}
		});
	}

	@Override
	protected void onResume() {
		// TODO Auto-generated method stub
		super.onResume();
	}

	@Override
	protected void onDestroy() {
		// TODO Auto-generated method stub
		super.onDestroy();
	}
}
